<%-- 
    Document   : lojas
    Created on : Nov 9, 2012, 12:26:28 PM
    Author     : JoséRego
--%>

<%@page import="java.sql.ResultSet"%>
<%@page import="ligacaoBD.BDconnection"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>KomprAki</title>
        <link href="css/bootstrap.css" rel="stylesheet">
        <link href="css/geral.css" rel="stylesheet">
        <link href="css/bootstrap-responsive.css" rel="stylesheet">
        <script type="text/javascript" src="js/bootstrap.js"></script>
        <script type="text/javascript" src="js/Maps.js" ></script>
        <script type="text/javascript" src="js/Pesquisa.js" ></script>
        <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB800NyPxDFvFh20RWKmJx_x0z9Ifc4-gw&sensor=false"></script>
    </head>
    <body onload="init();">
        <div class="navbar navbar-inverse navbar-fixed-top">
            <div class="navbar-inner">
                <div class="container">
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </a>
                    <a class="brand" href="#">KomprAki</a>
                    <div class="nav-collapse collapse">
                        <!--
                       <ul class="nav">
                          <li class="active"><a href="#">Home</a></li>
                           <li><a href="#about">About</a></li>
                           <li><a href="#contact">Contact</a></li>
                           <li class="dropdown">
                               <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown<b class="caret"></b></a>
                               <ul class="dropdown-menu">
                                   <li><a href="#">Action</a></li>
                                   <li><a href="#">Another action</a></li>
                                   <li><a href="#">Something else here</a></li>
                                   <li class="divider"></li>
                                   <li class="nav-header">Nav header</li>
                                   <li><a href="#">Separated link</a></li>
                                   <li><a href="#">One more separated link</a></li>
                               </ul>
                           </li>
                       </ul>
                        -->
                        <form class="navbar-form pull-right">
                            <input class="span2" type="text" placeholder="Username">
                            <input class="span2" type="password" placeholder="Password">
                            <button type="submit" class="btn">Entrar</button>
                            <a class="btn btn-primary">Registar</a>
                        </form>
                    </div><!--/.nav-collapse -->
                </div>
            </div>
        </div>
    <center>
        <br/> 
        <br/>
        <br/>
        <br/>
        <div class="input-append">
            <input class="span2" type="text"  value="" id="pesquisa" placeholder="Pesquisa" style="width: 500px"onkeyup="pesquisaLojas(this.value);"><span class="add-on"><i class="icon-search"></i></span>
        </div>
        <table width="1000" border="0">    
            <tr>
                <td>
                    <table width="600"border="0" id="listaLojas" name="listaLojas">
                        <%
                            BDconnection bd = new BDconnection();
                            ResultSet rs = bd.runQuery("SELECT * from Loja");


                            while (rs.next()) {
                        %>
                        <tr id="<%=rs.getString("idLoja")%>" onclick="addMaker(<%=rs.getString("coordx")%>,<%=rs.getString("coordy")%>)" onmouseover="this.style.background= 'LightGrey';" onmouseout="this.style.background='white';">
                            <td><h3><%=rs.getString("Nome")%></h3>
                                <p class="muted"><%=rs.getString("Rua")%>, <%=rs.getString("Localidade")%> - <%=rs.getString("Pais")%> <p>
                            </td>
                        </tr>
                        <%
                            }
                            bd.close();
                        %>
                    </table>
                </td>
                <td width="400">
                    <br />
                    <div id="map_canvas" style="width:600px;height:500px;"></div>
                </td>
            </tr>
        </table>
    </center>
</body>
</html>
